﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Admin_Master.master" AutoEventWireup="true" CodeFile="category.aspx.cs" Inherits="admin_Category" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <ul id="top-navigation">
        
        <li><span><span><a href="user.aspx">Users</a></span></span></li>
        <li><span><span><a href="product.aspx">Products</a></span></span></li>
        <li class="active"><span><span><a href="category.aspx">Category</a></span></span></li>
        <li><span><span><a href="order.aspx">Orders</a></span></span></li>
        
    </ul>
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="top-bar">
        <a href="#Add" style="float: left; background-color: blue; padding: 4px; color: white; font-weight: bold;">ADD NEW </a>
    </div>
    <br />
    <div class="select-bar">
        <label>
            <asp:TextBox ID="txtInputSearch" runat="server"></asp:TextBox>
        </label>
        <label>
            <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
        </label>
    </div>
    <div class="table" >


        <asp:GridView runat="server" ID="gvCategory" CellPadding="2" ForeColor="Black" GridLines="None" AutoGenerateColumns="False" PageSize="5" OnSelectedIndexChanged="gvCategory_SelectedIndexChanged" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" OnRowDeleting="gvCategory_RowDeleting" OnRowEditing="gvCategory_RowEditing" OnRowUpdating="gvCategory_RowUpdating" OnRowCancelingEdit="gvCategory_RowCancelingEdit" AllowPaging="True" OnPageIndexChanging="gvCategory_PageIndexChanging">
            <AlternatingRowStyle BackColor="PaleGoldenrod" />
            <Columns>
                <asp:TemplateField HeaderText="Category Id" SortExpression="CateId">
                    <EditItemTemplate>
                        <asp:Label ID="lblCateIdEdit" runat="server" Text='<%# Bind("CateId") %>'></asp:Label>
                    </EditItemTemplate>
                     <ItemTemplate>
                        <asp:Label ID="lblCateId" runat="server" Text='<%# Bind("CateId") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" CssClass="StyleHeader" />
                    <ItemStyle HorizontalAlign="Center" CssClass="StyleShort"  />
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Category Name" >
                    <EditItemTemplate>
                        <asp:TextBox ID="txtCateName" runat="server" Text='<%# Bind("CateName") %>'></asp:TextBox>
                    </EditItemTemplate>
                     <ItemTemplate>
                        <asp:Label ID="lblCateName" runat="server" Text='<%# Bind("CateName") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center"  CssClass="StyleHeader" />
                    <ItemStyle HorizontalAlign="Center"  CssClass="StyleLong" />
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Description of Category ">
                    <EditItemTemplate>
                         <asp:TextBox ID="txtCateEdit" runat="server" TextMode="MultiLine" Height="50" Text='<%# Bind("Description") %>' Width="220" Enabled="true" CssClass="StyleLong"></asp:TextBox>
                    </EditItemTemplate>
                     <ItemTemplate>
                         <asp:TextBox BorderStyle="Solid"  ID="txtCate" runat="server" TextMode="MultiLine" Height="50" Text='<%# Bind("Description") %>' Width="220" Enabled="False" CssClass="StyleLong" BorderColor="#EBEBE4"></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center"  CssClass="StyleHeader" />
                    <ItemStyle HorizontalAlign="Center"  CssClass="StyleLong" />
                </asp:TemplateField>
               
                <asp:TemplateField HeaderText="Delete" ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtDelete" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" CssClass="StyleHeader"  />
                    <ItemStyle HorizontalAlign="Center"  CssClass="StyleShort" />
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Edit Category" ShowHeader="False">
                    <EditItemTemplate>
                        <asp:LinkButton ID="lbtUpdate" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="lbtCancel" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="lbtEdit" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton>
                    </ItemTemplate>
                     <HeaderStyle HorizontalAlign="Center" CssClass="StyleHeader"   />
                    <ItemStyle HorizontalAlign="Center"  CssClass="StyleShort" />
                </asp:TemplateField>

            </Columns>
            <FooterStyle BackColor="Tan" />
            <HeaderStyle BackColor="#9097A9" Font-Bold="True" Width="100px"   ForeColor="White" Height="30" />
            <PagerStyle BackColor="#9097A9" ForeColor="White" HorizontalAlign="Center" Font-Size="13" />
            <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="White" />
            <RowStyle BackColor="#D8D8D8" ForeColor="black" />
            <SortedAscendingCellStyle BackColor="#FAFAE7" />
            <SortedAscendingHeaderStyle BackColor="#DAC09E" />
            <SortedDescendingCellStyle BackColor="#E1DB9C" />
            <SortedDescendingHeaderStyle BackColor="#C2A47B" />
        </asp:GridView>
       

    </div>



    <div class="table">
        <a name="Add"></a>
        <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
        <table class="listing form" cellpadding="0" cellspacing="0">
            <tr>
                <th class="full" colspan="2">Add  a new Category</th>
            </tr>
            <tr>
                <td class="first" width="172"><strong>Category Name: </strong></td>
                <td class="last">
                    <asp:TextBox ID="txtNameCategory" runat="server" Width="262"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="B&#7841;n ph&#7843;i nh&#7853;p tên Category!!" ClientIDMode="Inherit" ValidationGroup="addCate" ControlToValidate="txtNameCategory" CssClass="error"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr class="bg">
                <td class="first"><strong>Description of Category:</strong></td>
                <td class="last">
                    <asp:TextBox ID="txtCateDescription" runat="server" Width="262" Height="100px" TextMode="MultiLine"></asp:TextBox></td>
            </tr>
            <tr>
                <td class="first"></td>
                <td class="last">
                    <asp:Button ID="txtAddCategory" runat="server" Text="Add" CssClass="button1" ValidationGroup="addCate" OnClick="txtAddCategory_Click" />
                    <input id="Reset1" type="reset" value="Reset" class="button1" />
                </td>
            </tr>

        </table>
        <p>&nbsp;</p>
    </div>
</asp:Content>

